package com.yunxi.service.localService.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yunxi.dao.order.OrderOemCustomerMapper;
import com.yunxi.model.order.OrderOemDetails;
import com.yunxi.model.order.OrderOemDetailsAlreadySubmit;
import com.yunxi.model.order.OrderOemManagerDetails;
import com.yunxi.order.pojo.*;
import com.yunxi.service.localService.OrderOemManagerCustomerService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service(value = "orderOemManageCustomerServiceImpl")
public class OrderOemManagerCustomerServiceImpl extends ServiceImpl<OrderOemCustomerMapper, OrderOemManagerDetails> implements OrderOemManagerCustomerService {

    /**
     * 分页查询批售单或寄售单
     * @param vo
     * @param pageIndex
     * @param pageSize
     * @return
     */
    @Override
    public PageInfo<OrderOemRespVO> queryPmsOrderOemForPage(OrderOemReqVO vo, int pageIndex, int pageSize){
        PageHelper.startPage(pageIndex,pageSize);
        List<OrderOemRespVO> details = this.baseMapper.queryPmsOrderOemForPage(vo);
        PageInfo<OrderOemRespVO> pageInfo = new PageInfo<>(details);
        return pageInfo;
    }

    @Override
    public PageInfo<OrderOemDetailsAlreadySubmitRespVO> queryOrderOemDetailsAlreadySubmitForPage(OrderOemDetailsAlreadySubmitReqVO vo, int pageIndex, int pageSize) {
        PageHelper.startPage(pageIndex,pageSize);
        List<OrderOemDetailsAlreadySubmitRespVO> details = this.baseMapper.queryOrderOemDetailsAlreadySubmitForPage(vo);
        PageInfo<OrderOemDetailsAlreadySubmitRespVO> pageInfo = new PageInfo<>(details);
        return pageInfo;
    }

    /**
     * 批售单编辑详情查询
     * @param vo
     * @return
     */
    @Override
    public OrderOemDetailsRespVO queryOrderOemDetails(OrderOemDetailsReqVO vo) {

        return  this.baseMapper.queryOrderOemDetails(vo);
    }

    @Override
    public List<CustomPackDetailsRespVO> queryCustomPackDetails(CustomPackDetailsReqVO vo) {

        return  this.baseMapper.queryCustomPackDetails(vo);
    }

    @Override
    public PageInfo<ModifyOrderRespVO> queryModifyOrderForPage(ModifyOrderReqVO vo, int pageIndex, int pageSize) {
        PageHelper.startPage(pageIndex,pageSize);
        List<ModifyOrderRespVO> details = this.baseMapper.queryModifyOrderForPage(vo);
        PageInfo<ModifyOrderRespVO> pageInfo = new PageInfo<>(details);
        return pageInfo;
    }
}
